# vim:set ft=dockerfile:
FROM rocker/geospatial

MAINTAINER "Chenliang Wang" chenliangwang08ms@gmail.com

RUN apt install gdal-bin && install2.r --error \ 
	-r "https://cran.rstudio.com" \
	Rserve spgwr dplyr vegan formula.tools randomForest e1071 MASS gbm DEoptimR robustbase RcppArmadillo GWmodel xgboost  && \
    R -e "remotes::install_github('drsimonj/twidlr')" && \
	rm -rf /tmp/downloaded_packages/ /tmp/*.rds   

EXPOSE 6311 8787
#CMD ["cd /usr/local/lib/R/site-library/Rserve/libs/ && R CMD ./Rserve --no-restore --no-save --slave  --RS-enable-remote --RS-port 6311"]
#CMD  R -e "Rserve::Rserve(remote=TRUE)" &&  /usr/lib/rstudio-server/bin/rserver --server-daemonize 0

ENTRYPOINT R -e "Rserve::Rserve(args=' --no-restore --no-save --slave --RS-enable-remote',quote=F)" && /init


